<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title site-title">
		<legend>
			<a name="fixbar" style="font-size: 16px; color: #ce2424;">同学录</a>
		</legend>
	</fieldset>
	
	<table id="student_table"></table>

	<script type="text/html" id="toolbarDemo">
		<button class="layui-btn layui-btn-sm" lay-event="search">查询</button>
	</script>
	<script type="text/html" id="toolbarDemos">
		<form class="layui-form" action="save" id="myForm" method="post" lay-filter="stuform">
		<input type="text" style="display: none;" />
			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px">查询内容:</label>
				<div class="layui-input-block">
					<input type="text" name="search" id="searchvalue" value="${search}" onkeypress="return onKeyPress(event)" class="layui-input" />
				</div>
			</div>
			<div class="layui-inline">
				<button class="layui-btn layui-btn-sm" onclick="searchs()" style="margin-left: 16px"><i class="fa fa-search"></i>查询</button>
			</div>
		</form>
	</script>
	<script type="text/javascript">
		var option={
			elem:'#student_table',
			title:'学生列表',
			path:'schoolmate',
			toolbar: '#toolbarDemos',
			addurl:'edit',
			where:{username:'${param.username}',name:'${param.name}',sex:'${param.sex}'},
			//sort: 'name',
			//winWidth: '800px',
			defaultToolbar: ['filter', 'print', 'exports'],
			limit: 20,
			cols : [ 
				[ 
				{field : 'tbClass',title : '班级',hide: true,templet: function(d){
					return d.tbClass?d.tbClass.name:'';
				}}, 
				{field : 'name',title : '姓名'}, 
				{field : 'sex',title : '性别',width:80}, 
				{field : 'bron',title : '出生日期'}, 
				{field : 'politicstime',title : '入党时间'}, 
				{field : 'degree',title : '文化程度'}, 
				{field : 'speciality',title : '专业技术职称'}, 
				{field : 'workUnit',title : '工作单位'}, 
				{field : 'position',hide: true,title : '班级职务'},
			]]
		}
		var currRow='${param.currRow==null?null:param.currRow}';
		var limit=${param.limit==null?'null':param.limit};
		var page=${param.page==null?'null':param.page};
		var classTable=new LayUiTable(option,currRow,limit,page);
		classTable.init();
		
		function searchs(){
			classTable.search();
		}
		function empty(){
			classTable.empty();
		} 
		function onKeyPress(event){
			if(event.keyCode==13){
				searchs();
			}
		}
			
	</script>
</body>
</html>